package com.ferrlo.test;

import java.util.HashMap;
import java.util.List;
import java.util.Map;

import org.junit.Test;

import com.ferrlo.model.Admin;
import com.ferrlo.model.User;
import com.ferrlo.service.IAdminManager;
import com.ferrlo.service.IUserManager;
import com.ferrlo.service.impl.UserManager;
import com.ferrlo.utils.SpringUtils;

public class testManager extends SpringUtils{
	
	@Test
	public void test(){
		IUserManager userManager = (IUserManager) applicationContext.getBean("userManager");
		
		String dqQuery = "UserManager.findUserByUNickName.query";
		Map<String, Object> map = new HashMap<String, Object>();
		map.put("nickName", "caltyang");
		List<User> users = userManager.findListByDynamicQuery(dqQuery,map);
		
		System.out.println("==== "+users.size());
		
	}
	
	@Test
	public void testAdmin(){
		IAdminManager adminManager = (IAdminManager) applicationContext.getBean("adminManager");
		
		String dqQuery = "AdminManager.findAdminByAName.query"; 
		Map<String, Object> map = new HashMap<String, Object>();
		map.put("name", "demo");
		List<Admin> admins = adminManager.findListByDynamicQuery(dqQuery,map);
		
		System.out.println("==== "+admins.size());
	}

}
